package mrms.api.repository;

import mrms.api.entity.UserEntity;
import mrms.api.entity.DeptEntity;
import org.apache.catalina.User;
import org.springframework.data.domain.Page;
import org.springframework.data.domain.Pageable;
import org.springframework.data.jpa.repository.JpaRepository;

import java.util.List;

/**
 * @author lenchu
 * @date 2019/02/01
 */
public interface UserRepository extends JpaRepository<UserEntity, String> {
    List<UserEntity> findByIdIn(List<String> ids);

    Page<UserEntity> findAllByEnabled(Integer enabled, Pageable pageable);

    List<UserEntity> findAllByNameLikeAndEnabled(String name, Integer enabled);

    List<UserEntity> findAllByDept(DeptEntity dept);

    UserEntity findUserEntityByTel(String tel);
}
